//
//  LSZVideoOfflineCacheTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/3/16.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZVideoOfflineCacheTableViewCell.h"

@implementation LSZVideoOfflineCacheTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewCover = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 100, 80)];
        [self addSubview:self.imageViewCover];

        self.labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.imageViewCover.frame)+10, 10, ScreenWidth-CGRectGetMaxX(self.imageViewCover.frame)-20-40, 40)];
        self.labelTitle.font = FONT_14;
        self.labelTitle.textColor = RGBColor(51, 51, 51);
        self.labelTitle.numberOfLines = 0;
        [self addSubview:self.labelTitle];

        self.labelAuthor = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.imageViewCover.frame)+10, CGRectGetMaxY(self.labelTitle.frame)+10, ScreenWidth-CGRectGetMaxX(self.imageViewCover.frame)-20-40, 20)];
        self.labelAuthor.font = FONT_12;
        self.labelAuthor.textColor = RGBColor(121, 121, 121);
        [self addSubview:self.labelAuthor];

        self.butDelete = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.labelTitle.frame), 0, 50, 100)];
        [self.butDelete setImage:[UIImage imageNamed:@"我的_下载_删除"] forState:UIControlStateNormal];
         [self addSubview:self.butDelete];
    }
    return self;
}
-(void)setVideoManager:(LSZOfflineVideoMg *)videoManager
{
    [self.imageViewCover sd_setImageWithURL:[NSURL URLWithString:videoManager.imageViewUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.labelTitle.text = NSStr(videoManager.title);
    self.labelAuthor.text = [NSString stringWithFormat:@"作者:%@",NSStr(videoManager.name)];
}
@end
